<?php
/***
 * Taken from massasi.com,
 * need an efficient way to sandbox the tpl 
 * from eval() and etc, though.
 **/
require_once('../util/consts.php');

class Bitter 
{
  private $tplvars;

  function Bitter($tplfile) {
    $this->file = STYLE_TPL_DIR . FILE_SEPARATOR . STYLE_NAME . FILE_SEPARATOR . $file . STYLE_FILE_TYPE;
  }
  function set($name, $var) {
    $this->tplvars[$name] = is_object($value) ? $value->fetch() : $value;
  }
  function show() {
    extract($this->vars);
    ob_start();
    include($file); // XXX error if not
    $contents = ob_get_contents();
    ob_end_clean();
    return $contents;
  }
}

?>
